package com.demo.gulimall.product.service.impl;

import com.demo.gulimall.product.entity.AttrGroup;
import com.demo.gulimall.product.mapper.AttrGroupMapper;
import com.demo.gulimall.product.service.AttrGroupService;
import com.demo.gulimall.product.vo.ItemSpuAttrGroupVo;
import com.demo.gulimall.product.vo.SkuItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * 属性分组
 *
 * @author Chen Yuan
 */

@Service
public class AttrGroupServiceImpl extends ServiceImpl<AttrGroupMapper, AttrGroup> implements AttrGroupService {

    @Autowired
    private AttrGroupMapper attrGroupMapper;

    @Override
    public List<ItemSpuAttrGroupVo> getAttrGroupWithAttrBySpuId(Long spuId, Long catalogId) {
        // 查出当前 SPU 对应的所有的分组信息, 以及每个分组对应的值
        return baseMapper.selectAttrGroupWithAttrBySpuId(spuId, catalogId);

    }
}
